package com.alibaba.cloud.clinic.api.feign;

import com.alibaba.cloud.clinic.api.vm.MedItemVM;
import com.alibaba.cloud.clinic.api.vm.MedSheetVM;
import com.alibaba.cloud.clinic.constant.ClinicConstant;
import com.alibaba.framework.domain.ResponseWrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = ClinicConstant.ALICLOUD_MEDICINE, fallback = MedicineServiceFallback.class)
public interface MedicineServiceFeign {

    @GetMapping("/meditem/list")
    ResponseWrapper<List<MedItemVM>> getAll();

    @PostMapping("/meditem/deduct")
    ResponseWrapper<Integer> deduct(@RequestParam("medCode") String medCode, @RequestParam("medStock") Integer medStock);

    @PostMapping("/medSheet/add")
    ResponseWrapper<Integer> addMedSheet(@RequestBody MedSheetVM medSheetVM);
}
